package cn.hy.mvc;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

/**
 * @Author huang.xy
 * @Description TODO
 */
public class Handler {

    private Object instance;

    private Method method;

    private Pattern pattern;
    // 参数和下标 的映射
    private final Map<Object,Integer> parameterIndexMap = new HashMap<>();


    public Handler(Object instance, Method method, Pattern pattern) {
        this.instance = instance;
        this.method = method;
        this.pattern = pattern;
    }

    public Object getInstance() {
        return instance;
    }

    public void setInstance(Object instance) {
        this.instance = instance;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Pattern getPattern() {
        return pattern;
    }

    public void setPattern(Pattern pattern) {
        this.pattern = pattern;
    }

    public Map<Object, Integer> getParameterIndexMap() {
        return parameterIndexMap;
    }
}
